import { network } from '@/utils';
import { DetailInfoPatams } from './data';

import { basic } from '../../../../../config/Apis';

export async function queryLogisRegionList(params: DetailInfoPatams) {
  return network.get(basic.logisRegion_list, {
    params,
  });
}

export async function operSaveCabs(params: { id: number }) {
  return network.post(basic.logisRegion, {
    data: params,
  });
}

export async function operDeleteCabinet(params: { id: number }) {
  return network.deleter(basic.logisRegion, {
    params,
  });
}

export async function querySaveList(params: any) {
  let path: any = '';
  if (params.type === 0) {
    delete params.type;
    path = network.get(basic.cab_list, { params });
  } else {
    if (params.type === 2) params.type = 0;
    path = network.get(basic.shelf_list, { params });
  }

  return path;
}
